<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
		<meta name="apple-mobile-web-app-capable" content="yes"/>
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
		<meta name="apple-mobile-web-app-title" content="墨藏老酒">
		<link rel="stylesheet" href="css/mui.css">
		<link rel="stylesheet" href="css/login.css">
		<link rel="stylesheet" href="font_1164560_51nk3uh81z5/iconfont.css">
		<title>登录</title>
		<style>
			.mui-bar-nav{background: transparent;box-shadow: none;}
			.mui-bar-nav a{color:#333;}
			.mui-bar-nav h1{color:#333;text-align: center;}
			.mui-title{font-size: 15px;}
			.content{margin-top:44px;}
		</style>
	</head>
	<body>
		 <header class="mui-bar mui-bar-nav">
			<a id="back" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">登录</h1>
		</header>
		 <div class="content">
			 <div class="logo">
				 <img src="img/logo.png" alt="">
			 </div>
			 <div class="login">
				 <form action="">
				 	<div>
						<i class="icon iconfont">&#xe627;</i>
						<input type="text" placeholder="请输入手机号">
					</div>
					<div>
						<i class="icon iconfont">&#xe60d;</i>
						<input type="password" placeholder="请输入密码">
					</div>
					<div class="verify">
						<div class="verify_left">
							<i class="icon iconfont">&#xe8f7;</i>
							<input type="password" placeholder="请输入验证码">
						</div>
						<div id="check-code" style="overflow: hidden;" class="verify_right">
							<div class="code" id="data_code"></div>
						</div>
					</div>
					
					<div class="btn">
						<div><button>登录</button></div>
						<div class="reg">
							<a href="registe.html">新用户注册</a>
							<a href="forgetpwd.html">忘记密码?</a>
						</div>
					</div>
				 </form> 
			 </div>
		 </div>
	</body>
	<script src="js/jquery-1.9.1.js"></script>
	<script src="js/mui.js"></script>
	<script type="text/javascript">
	/**
	 * 验证码
	 * @param {Object} o 验证码长度
	 */
	$.fn.code_Obj = function(o) {
		var _this = $(this);
		var options = {
			code_l: o.codeLength,//验证码长度
			codeChars: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
				'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
				'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
			],
			codeColors: ['#f44336', '#009688', '#cddc39', '#03a9f4', '#9c27b0', '#5e4444', '#9ebf9f', '#ffc8c4', '#2b4754', '#b4ced9', '#835f53', '#aa677e'],
			code_Init: function() {
				var code = "";
				var codeColor = "";
				var checkCode = _this.find("#data_code");
				for(var i = 0; i < this.code_l; i++) {
					var charNum = Math.floor(Math.random() * 52);
					code += this.codeChars[charNum];
				}
				for(var i = 0; i < this.codeColors.length; i++) {
					var charNum = Math.floor(Math.random() * 12);
					codeColor = this.codeColors[charNum];
				}
				console.log(code);
				if(checkCode) {
					checkCode.css('color', codeColor);
					checkCode.className = "code";
					checkCode.text(code);
					checkCode.attr('data-value', code);
				}
			}
		};

		options.code_Init();//初始化验证码
		_this.find("#data_code").bind('click', function() {
			options.code_Init();
		});
	};
</script>
<script type="text/javascript">
	/**
	 * 验证码
	 * codeLength:验证码长度
	 */
	$('#check-code').code_Obj({
		codeLength: 4
	});
</script>
</html>

</html>
